package com.dkd.manage.service.impl;

import java.util.List;
import com.dkd.common.utils.DateUtils;
import com.dkd.manage.domain.vo.ReportRepairVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dkd.manage.mapper.ReportRepairMapper;
import com.dkd.manage.domain.ReportRepair;
import com.dkd.manage.service.IReportRepairService;

/**
 * 报修管理Service业务层处理
 * 
 * @author czq
 * @date 2024-11-09
 */
@Service
public class ReportRepairServiceImpl implements IReportRepairService 
{
    @Autowired
    private ReportRepairMapper reportRepairMapper;

    /**
     * 查询报修管理
     * 
     * @param id 报修管理主键
     * @return 报修管理
     */
    @Override
    public ReportRepair selectReportRepairById(Long id)
    {
        return reportRepairMapper.selectReportRepairById(id);
    }

    /**
     * 查询报修管理列表
     * 
     * @param reportRepair 报修管理
     * @return 报修管理
     */
    @Override
    public List<ReportRepair> selectReportRepairList(ReportRepair reportRepair)
    {
        return reportRepairMapper.selectReportRepairList(reportRepair);
    }

    /**
     * 新增报修管理
     * 
     * @param reportRepair 报修管理
     * @return 结果
     */
    @Override
    public int insertReportRepair(ReportRepair reportRepair)
    {
        reportRepair.setCreateTime(DateUtils.getNowDate());
        reportRepair.setRepairStatus(0L);
        return reportRepairMapper.insertReportRepair(reportRepair);
    }

    /**
     * 修改报修管理
     * 
     * @param reportRepair 报修管理
     * @return 结果
     */
    @Override
    public int updateReportRepair(ReportRepair reportRepair)
    {
        reportRepair.setUpdateTime(DateUtils.getNowDate());
        return reportRepairMapper.updateReportRepair(reportRepair);
    }

    /**
     * 批量删除报修管理
     * 
     * @param ids 需要删除的报修管理主键
     * @return 结果
     */
    @Override
    public int deleteReportRepairByIds(Long[] ids)
    {
        return reportRepairMapper.deleteReportRepairByIds(ids);
    }

    /**
     * 删除报修管理信息
     * 
     * @param id 报修管理主键
     * @return 结果
     */
    @Override
    public int deleteReportRepairById(Long id)
    {
        return reportRepairMapper.deleteReportRepairById(id);
    }

    @Override
    public List<ReportRepairVo> selectReportRepairVoList(ReportRepair reportRepair) {
        return reportRepairMapper.selectReportRepairVoList(reportRepair);
    }
}
